home *** CD-ROM | disk | FTP | other *** search
/ Tiger Disk 43 / Tiger_Disk_043_1997-10_Tiger-Crew-Disk_de_Side_A.d64 / basic mandelbrot (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  1KB  |  53 lines

  1. 2 rem mandelbrot-beispielprogramm
  2. 4 rem ---------------------------
  3. 6 rem (c) marc 'blackjack' rintsch
  4. 8 rem (p) tiger disk in 1997
  5. 10 rem
  6. 12 x1 = -2 :rem real-min
  7. 14 x2 =  2 :rem real-max
  8. 16 y1 = -2 :rem imaginaer-min
  9. 18 y2 =  2 :rem imaginaer-max
  10. 20 :
  11. 22 mt = 15 :rem rekursionstiefe
  12. 24 :
  13. 26 cr = x1:rem ausgangswert fuer
  14. 28 ci = y1:rem die konstante c
  15. 30 :
  16. 32 dx = (x2-x1)/39:rem additions-
  17. 34 dy = (y2-y1)/24:rem konstanten
  18. 36 :
  19. 38 dim c(4):rem farben festlegen
  20. 40 c(0)=6:c(1)=4:c(2)=14:c(3)=3:c(4)=1
  21. 42 :
  22. 44 rem bildschirm mit "[209]" fuellen
  23. 46 print "[151][147]";
  24. 48 poke 53280,0
  25. 50 poke 53281,0
  26. 52 for y=0 to 999
  27. 54   poke 1024+y,81
  28. 56 next
  29. 58 :
  30. 60 ti$="000000":rem stoppuhr auf 0
  31. 62 :
  32. 64 for y=0 to 24
  33. 66   for x=0 to 39
  34. 68     t=0:r=0:i=0
  35. 70     rh = (r * r - i * i) + cr
  36. 72     ih = 2 * r * i + ci
  37. 74     r = rh
  38. 76     i = ih
  39. 78     if (r*r+i*i)>4 then86
  40. 80     t=t+1
  41. 82     if t=mt then c=0:goto88
  42. 84     goto70
  43. 86     c=c(t-int(t/5)*5)
  44. 88     poke 55296+y*40+x,c
  45. 90     cr=cr+dx
  46. 92   next
  47. 94   ci=ci+dy
  48. 96   cr=x1
  49. 98 next
  50. 100 xx=ti/60
  51. 102 print "zeit:";xx;"sek."
  52. 104 poke 198,0:wait 198,1
  53.